package com.itheima.springbootwebtlias.controller;

import com.itheima.springbootwebtlias.pojo.PageResult;
import com.itheima.springbootwebtlias.pojo.Result;
import com.itheima.springbootwebtlias.service.LogService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@Slf4j
@RequestMapping("/log")
@RestController
public class LogController {

    @Autowired
    private LogService logService;

    //日志列表分页查询
    @GetMapping("/page")
    public Result page(@RequestParam Map<String, String> map){
        log.info("分页查询，参数：{}", map);

        PageResult pageResult = logService.page(map);

        return Result.success(pageResult);
    }
}
